package factory.one.entity;

import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @author sk.z
 * 2023/9/20
 * 收支
 **/
public class Money {

    private Long id;
    private Long orderId;
    private Integer type; // 1-收入 2-支出
    private String content;
    private Long amount;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date occurTime; //发生时间
    private String createUser; //创建用户
    private Date createTime; //创建时间
    private Integer status; //0-删除 1-正常

    private BigDecimal amountTmp; //web接参

    public static final String CREATE_SQL = "    create table MONEY (\n" +
            "        ID bigint not null GENERATED ALWAYS AS IDENTITY,\n" +
            "        ORDER_ID bigint not null,\n" +
            "        TYPE int not null,\n" +
            "        CONTENT varchar(255) not null,\n" +
            "        AMOUNT bigint not null,\n" +
            "        OCCUR_TIME timestamp not null,\n" +
            "        CREATE_USER varchar(32) not null,\n" +
            "        CREATE_TIME timestamp not null,\n" +
            "        STATUS int default 1,\n" +
            "        primary key (ID)\n" +
            "    )";

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getOrderId() {
        return orderId;
    }

    public void setOrderId(Long orderId) {
        this.orderId = orderId;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Long getAmount() {
        return amount;
    }

    public void setAmount(Long amount) {
        this.amount = amount;
    }

    public String getCreateUser() {
        return createUser;
    }

    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Date getOccurTime() {
        return occurTime;
    }

    public void setOccurTime(Date occurTime) {
        this.occurTime = occurTime;
    }

    public BigDecimal getAmountTmp() {
        return amountTmp;
    }

    public void setAmountTmp(BigDecimal amountTmp) {
        this.amountTmp = amountTmp;
    }
}
